<?php
include_once 'library/Bootstrap/ModuleBootstrap.php';
class FrontBootstrap extends ModuleBootstrap{
	public function _init(){
		/*////////////////////////////////////*/
		$pattern = '/\/(.*)\/(.*)-(.*).p.html/';
		$route = new Route(
				"product details",
				$pattern,
				array(
						Configuration::CONTROLLER => 'Product',
						Configuration::ACTION=>"details",
						Configuration::VIEW=>Configuration::VIEW_DEFAULT,
						Configuration::VIEW_TYPE=>Configuration::VIEW_TYPE_DEFAULT,
						'productcat'=>'$1',
						'productalias'=>'$2',
						'productid'=>'$3'
				)
		);
		$this->addRoute($route);
		/*////////////////////////////////////*/
		$pattern = '/\/(.*)\/(.*)-(.*).t.html/';
		$route = new Route(
				"news details",
				$pattern,
				array(
						Configuration::CONTROLLER => 'News',
						Configuration::ACTION=>"details",
						Configuration::VIEW=>Configuration::VIEW_DEFAULT,
						Configuration::VIEW_TYPE=>Configuration::VIEW_TYPE_DEFAULT,
						'newscat'=>'$1',
						'newsalias'=>'$2',
						'newsid'=>'$3'
				)
		);
		$this->addRoute($route);
		/*////////////////////////////////////*/
		$pattern = '/\/(.*)-(.*).c.html/';
		$route = new Route(
				"product cat",
				$pattern,
				array(
						Configuration::CONTROLLER => 'Product',
						Configuration::ACTION=>"cat",
						Configuration::VIEW=>Configuration::VIEW_DEFAULT,
						Configuration::VIEW_TYPE=>Configuration::VIEW_TYPE_DEFAULT,
						'catalias'=>'$1',
						'catid'=>'$2'
				)
		);
		$this->addRoute($route);
		/*////////////////////////////////////*/
		$pattern = '/\/(.*)-(.*).n.html/';
		$route = new Route(
				"news cat",
				$pattern,
				array(
						Configuration::CONTROLLER => 'News',
						Configuration::ACTION=>"cat",
						Configuration::VIEW=>Configuration::VIEW_DEFAULT,
						Configuration::VIEW_TYPE=>Configuration::VIEW_TYPE_DEFAULT,
						'catalias'=>'$1',
						'catid'=>'$2'
				)
		);
		$this->addRoute($route);
		/* /////////////////////////////////////////// */
		$pattern = '/(.*)\/(.*)\/(.*)\.(.*)/';
		$route = new Route(
					"controler-action-view-viewtype", 
		$pattern,
		array(
		Configuration::CONTROLLER => '$1',
		Configuration::ACTION=>'$2',
		Configuration::VIEW=>'$3',
		Configuration::VIEW_TYPE=>'$4'
		)
		);
		$this->addRoute($route);
	}
}